home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene 96
/
Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso
/
misc
/
coding
/
vgacodng
/
part03_c.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-12-15
|
1KB
|
57 lines
program VertScrolly;
uses crt;
const VGA : word = $A000;
var i,j : word;
c : char;
procedure WaitRetrace;assembler;
asm
mov dx,3DAh
@l1:
in al,dx
and al,08h
jz @l1
@l2:
in al,dx
and al,08h
jz @l2
end;
procedure SetStart(Adresse:word);assembler;
asm
mov dx,3D4h { CRTC-Indexregister }
mov al,0Ch
mov ah,byte ptr Adresse + 1
out dx,ax
mov al,0Dh
mov ah,byte ptr Adresse
out dx,ax
end;
begin
randomize; { "Zufalls"zahlen generieren }
asm mov ax,13h; int 10h end; { VGA-Modus 13h }
for i := 0 to 65535 do mem[vga:i] := random(256);
{ Bildschirm füllen }
i := 0;
j := 80;
c := ' ';
repeat
if keypressed then begin
c := readkey;
if c = ' ' then j := -j { Richtung umkehren }
else exit;
end;
delay(10); { Ohne Delay zu schnell }
waitretrace;
SetStart(i); { Neue Startadresse setzen }
inc(i,j); { Zähler erhöhen/vermindern }
until c <> ' ';
readkey;
asm mov ax,03h; int 10h end; { Textmodus }
end.